package com.example.springbootbabyu.mapper;

import com.example.springbootbabyu.entity.LoginVO;
import com.example.springbootbabyu.entity.RegisterDTO;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;

@Mapper

public interface UserMapper {
    @Select("SELECT id, account, mobile, avatar, nickname, gender, birthday, city_code, province_code, profession FROM user WHERE account = #{account} AND password = #{password}")

    LoginVO selectByAccount(String account, String password);

    //
    @Insert("INSERT INTO user (id, account, password, mobile) values (#{account}, #{account}, #{password}, #{phone})")
    void insert(RegisterDTO registerDTO);
}
